package tests

import org.scalatest.FlatSpec
import org.scalatest.Matchers
import tp1._



class TestPrecios   extends FlatSpec with Matchers  {

   "reserva1" should "precio igual a 400.0" in {
   val cancha1 = new Cancha(new CanchaFutbol(10))
   val reserva1 = new Reserva(cancha1,3,4,12,14)
   reserva1.precioFinal should equal(400.0)
   }
   
    "reserva2" should "precio igual a 100.0" in {
   val cancha2 = new Cancha(new CanchaPaddle)
   val reserva2 = new Reserva(cancha2,3,5,12,14)
   reserva2.precioFinal should equal(100.0)
   }
  
   "reserva3" should "precio igual a 150.0" in {
   val cancha3 = new Cancha(new CanchaTennis)
   val reserva3 = new Reserva(cancha3,3,6,12,14)
   reserva3.precioFinal should equal(150.0)
   }
   
    "reserva4" should "precio igual a 400.0 antes de las 18" in {
   val cancha4 = new Cancha(new CanchaFutbol(10))
   val reserva4 = new Reserva(cancha4,3,6,12,14) with CanchaConLuz
   reserva4.precioFinal should equal(400.0)
   }
    
   "reserva5" should "precio igual a 480.0 despues de las 18" in {
   val cancha5 = new Cancha(new CanchaFutbol(10))
   val reserva5 = new Reserva(cancha5,3,3,19,20) with CanchaConLuz
   reserva5.precioFinal should equal(480.0)
   }
   
   "reserva6" should "precio igual a 100.0 en la semana" in {
   val cancha6 = new Cancha(new CanchaPaddle) 
   val reserva6 = new Reserva(cancha6,3,5,12,14) with CanchaConTribuna
   reserva6.precioFinal should equal(100.0)
   }
  
   "reserva7" should "precio igual a 200.0 fin de semana" in {
   val cancha7 = new Cancha(new CanchaPaddle)
   val reserva7 = new Reserva(cancha7,2,5,12,14) with CanchaConTribuna
   reserva7.precioFinal should equal(200.0)
   }
   
   "reserva8" should "precio igual a 165.0 si llueve" in {
   val cancha8 = new Cancha(new CanchaTennis)
   val reserva8 = new Reserva(cancha8,3,6,12,14) with CanchaConTecho
   val SMet = new ServicioMeteorologico(true)
   reserva8.clima=SMet.llueve
   reserva8.precioFinal should equal(165.0)
   }
   
   "reserva9" should "precio igual a 150.0 sin o llueve" in {
   val cancha8 = new Cancha(new CanchaTennis)
   val reserva8 = new Reserva(cancha8,3,6,12,14) with CanchaConTecho
   reserva8.precioFinal should equal(150.0)
   }
   
   "reserva10" should "precio igual a 330.0" in {
   val cancha8 = new Cancha(new CanchaTennis)
   val reserva8 = new Reserva(cancha8,2,7,12,14) with CanchaConTecho with CanchaConTribuna
   val SMet = new ServicioMeteorologico(true)
   reserva8.clima=SMet.llueve
   reserva8.precioFinal should equal(330.0)
   }
   
   "reserva11" should "precio igual a 396.0" in {
   val cancha8 = new Cancha(new CanchaTennis)
   val reserva8 = new Reserva(cancha8,2,7,18,20) with CanchaConTecho with CanchaConTribuna with CanchaConLuz
   val SMet = new ServicioMeteorologico(true)
   reserva8.clima=SMet.llueve
   reserva8.precioFinal should equal(396.0)
   }
   
   "reserva12" should "precio igual a 330.0" in {
   val cancha8 = new Cancha(new CanchaPaddle)
   val reserva8 = new Reserva(cancha8,2,4,19,20) with CanchaConTecho with CanchaConTribuna with CanchaConLuz
   val SMet = new ServicioMeteorologico(true)
   reserva8.clima=SMet.llueve
   reserva8.precioFinal should equal(264.0)
   }
   
  
    

}